package com.qingcloud.adminbackend.exception;


import com.qingcloud.adminbackend.enums.BizExceptionEnum;

/**
 * 基础异常类
 */
public class WmCommonException extends RuntimeException {



    private Integer code;

    private String message;
    public WmCommonException(String detailMessage) {
        super(detailMessage);
        this.message = detailMessage;
    }

    public WmCommonException(BizExceptionEnum serviceExceptionEnum,String detailMessage) {
        this.code = serviceExceptionEnum.getCode();
        this.message = detailMessage;
    }

    public WmCommonException(BizExceptionEnum serviceExceptionEnum) {
        this.code = serviceExceptionEnum.getCode();
        this.message = serviceExceptionEnum.getMessage();
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
